package com.project.service;

import com.project.entity.Discuss;
import com.project.entity.KnowLedge;
import com.project.entity.Question;
import com.project.mapper.DiscussMapper;
import com.project.mapper.QuestionMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class QuestionService {
    @Autowired
    private QuestionMapper questionMapper;

    public List<Question> findPage(Integer pageIndex, Integer pageCount) {
        int startIndex = (pageIndex - 1) * pageCount;


        return questionMapper.findPage(startIndex, pageCount);
    }

    public void addQuestion(Question question) {
        questionMapper.addQuestion(question);
    }
}
